<?php
defined('_JEXEC') or die;
?>
<div id="seriesList" class="glycoBox">
<div class="titleRow">
	<em class="nbr"><?php echo $this->total > 1 ? $this->total . ' séries' : $this->total . ' série' ; ?></em>
	<h2><?php echo 'Raffinerie '. $this->series[0]->raffinerie ; ?></h2>
</div>
<!--<div class="rowBoxHead">
	<div class="imgCol">Image</div>
	<div class="titleCol">Titre</div>
</div>-->
<?php
	$row = 'odd';
	$itemId = JRequest::getVar('Itemid', 0);
  $pays = JRequest::getVar('pays', 0);
	foreach($this->series as $serie){
	$nbrSS = count($serie->sseries);
	$row = $row == 'odd' ? '' : 'odd' ;
?>
<div class="rowBox <?php echo $row ; ?>">
	<div class="imgCol">
		<a href="index.php?option=com_glycophile&view=sucres&serie=<?php echo $serie->id; ?>&Itemid=<?php echo $itemId; ?>">
		<img src="<?php echo JURI::root() ; ?>components/com_glycophile/asset/images/<?php echo $serie->id_pays.'/'.$serie->code.'/'.$serie->id.'.gif' ; ?>"  alt="<?php echo $serie->serie; ?>"/>
		</a>
     <?php
      $user		= JFactory::getUser();
      if($user->id)
        {
        echo '<div class="page-club" style="margin-top: 10px;">Page : ';
        echo $serie->pageClub;
        echo "</div>";
      }
    ?>
	</div>
	<div class="titleCol"><h2><a href="index.php?option=com_glycophile&view=sucres&pays=<?php echo $pays; ?>&serie=<?php echo $serie->id; ?>&Itemid=<?php echo $itemId; ?>"><?php echo $serie->serie; ?></a></h2>
	<a target="_blank" href="index.php?option=com_glycophile&view=sucres&pays=<?php echo $pays; ?>&serie=<?php echo $serie->id; ?>&Itemid=<?php echo $itemId; ?>&tmpl=component" rel="rokbox" class="preview"><span class="icon-search"></span></a>
	</div>
	<div class="sousSeriesBox">
		<div class="rowBoxHead">
			<div class="sousSeriesRow">
				<div class="sucresCol">Sucre</div>
				<div class="variantesCol">Variantes</div>
				<div class="possedeCol">Posséde</div>
			</div>
		</div>
		<?php foreach($serie->sseries as $sserie){ ?>
		<div class="sousSeriesRow">
			<div class="sucresCol"><?php echo $sserie->nombre_serie; ?></div>
			<div class="variantesCol"><?php echo $sserie->sous_serie; ?></div>
			<div class="possedeCol"><?php echo $sserie->calcul_serie; ?></div>
		</div>
		<?php } ?>
	</div>
</div>
<?php //  echo '<pre>'; print_r($serie); echo '</pre>'; ?>
<?php } ?>
<?php echo $this->pagination; ?>
</div>

